package com.dayuan.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dayuan.bean.Address;
import com.dayuan.service.AddressService;
import com.dayuan.util.ExportExcel;

@Controller
@RequestMapping("/poi")
public class PoiController {

	
	@Resource
	private AddressService addressService;


	@RequestMapping(value = "/poidemo.im", method = { RequestMethod.POST, RequestMethod.GET })
	@ResponseBody
	public void  export(HttpServletRequest request, HttpServletResponse response,Integer userId) {
	
		 //servic
	        List<Address> addresslList = addressService.selectAddressByUserId(userId);
	        ExportExcel<Address> ee= new ExportExcel<Address>();  
	        String[] headers = { "序号","用户编号", "姓名", "手机号码", "状态" , "省", "室", "区", "具体地址"};  
	        String fileName = "地址表";  
	        ee.exportExcel(headers,addresslList,fileName,response);  
	}
	
}

